<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>查看销售退单</title>
<link href="<%=path%>/css/core.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/form.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/list.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/xWindowPanel.css" rel="stylesheet"
	type="text/css" />
<link href="<%=path%>/css/xToolbar.css" rel="stylesheet" type="text/css" />
<style type="text/css">
input {
	width: 180px;
}

textarea {
	width: 503px;
	height: 40px;
}

select {
	width: 188px;
}

.n {
	text-align: right;
}
</style>
</head>
<body>
	<s:if test="salesBackOrder.auditState == 2">
		<div id="toolbar"></div>
	</s:if>
	<div id="printArea">
	<div class="form-group">基本信息</div>
	<table class="form-table" cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td class="form-left"><span class="form-required">*</span>销售退单编号</td>
			<td class="form-right"><s:property value="salesBackOrder.code" />
			</td>
			<td class="form-left"><span class="form-required">*</span>退货日期</td>
			<td class="form-right"><s:date name="salesBackOrder.backDate"
					format="yyyy-MM-dd" />
			</td>
		</tr>
		<tr>
			<td class="form-left"><span class="form-required">*</span>退货原因</td>
			<td class="form-right"><s:property value="salesBackOrder.reason" />
			</td>
			<td class="form-left"><span class="form-required">*</span>操作人</td>
			<td class="form-right"><s:property
					value="salesBackOrder.operator.name" />
			</td>
		</tr>
	</table>

	<div class="form-group">退货单明细</div>
	<table id="titleTable" cellpadding="0" cellspacing="0">
		<tr>
			<td>销售订单编号</td>
			<td>销售日期</td>
			<td>货品编号</td>
			<td>货品名称</td>
			<td><span class="required">*</span>退货数量(个)</td>
		</tr>
	</table>
	<div style="overflow-y: scroll; height: 220px">
	<table id="dataTable" cellpadding="0" cellspacing="0">
		<s:iterator id="item" value="itemList" status="i">
			<tr class="row">
				<td><span><s:property
							value="#item.salesOrderProduct.salesOrder.code" /> </span></td>
				<td><span>
					<s:date name="#item.salesOrderProduct.salesOrder.orderDate" format="yyyy-MM-dd HH:mm"/></span>
				</td>
				<td><span><s:property
							value="#item.salesOrderProduct.product.code" /> </span>
				</td>
				<td><span><s:property
							value="#item.salesOrderProduct.product.name" /> </span>
				</td>
				<td><span><s:property value="#item.amounts" /> </span></td>
			</tr>
		</s:iterator>
	</table>
	</div>
	</div>
	<script src="<%=path%>/js/core.js" type="text/javascript"></script>
	<script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
	<script src="<%=path%>/js/Grid.js" type="text/javascript"></script>
	<script src="<%=path%>/js/jquery-impromptu.js" type="text/javascript"></script>
	<script src="<%=path%>/js/xToolbar.js" type="text/javascript"></script>
	<script src="<%=path%>/js/xToolbar.items.js" type="text/javascript"></script>
	<script type="text/javascript">
		var grid;

		$(document).ready(function() {
			new Toolbar({
				renderTo : 'toolbar',
				icon : '../../image/op.gif',
				border : 'both',
				items : [ {
					type : 'button',
					text : '打印',
					tip : '打印销售退单',
					useable : 'T',
					position : {
						a : '0px 0px',
						b : '0px -120px'
					},
					handler : function() {
						top.printOrder($("#printArea"));
					}
				} ]
			});
			grid = new Grid({
				titleTable : 'titleTable',
				dataTable : 'dataTable',
				widths : [ 120, 120, 100, 100, 85 ],
				height : 290
			});

			loadReady();
		});
	</script>
</body>
</html>